package com.zyc.app.woa;

import android.app.IntentService;
import android.content.Intent;
import com.zyc.app.woa.data.AccountInfo;
import com.zyc.app.woa.utils.Trace;

/**
 * Author: yingchang.zhang
 * Date  : 2014/12/22
 */
public class DownloadService extends IntentService {

    public DownloadService() {
        super("com.zyc.app.woa.DownloadService");
        Trace.log("DownloadService constructed ");
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        AccountInfo accountInfo = (AccountInfo) intent.getSerializableExtra(WxConfig.ACCOUNT_INFO);
        new ArticlesDownloadManager().startDownload(accountInfo);
        Trace.log("DownloadService onHandleIntent " + this);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Trace.log("DownloadService onDestroy " + this);
    }
}
